import { defineConfig } from "vite";
import  Component from 'unplugin-vue-components/vite';
import {VantResolver} from 'unplugin-vue-components/resolvers';
import uni from "@dcloudio/vite-plugin-uni";

// https://vitejs.dev/config/
export default defineConfig({
  //插件
	plugins: [uni(),
	//自动按需加载自动引入组件
	Component({
		resolvers:[VantResolver()],

	})],
	server:{
		proxy:{
			'/api':{ //代理所有以'/https://www.bestxinrui.com'开头的请求路径
				target:'https://www.bestxinrui.com:8040/',
				changeOrigin:true, //将host设置为target
				secure:true,
				rewrite:(path:any)=>path.replace(/^\/api/,''),
			},
	
		}
		
	}
});
